'use strict';
const BaseService = require('./base');


class SysUidService extends BaseService {

    async getUserNo() {


        let sql = `SELECT * from sys_uid WHERE type='U' AND valid=1 ORDER BY RAND() LIMIT 1`;
        let result = await this.executeSqlFirst(sql);
        if (result) {
            let sql = `update sys_uid set valid=0 where id=? `;
            await this.executeSqlSucc(sql, [result.id]);
        }
        return result ? result.type + result.uuid : '';

    }





}

module.exports = SysUidService;
